
	<script src="/site_media/admin/zTree/js/jquery.ztree.core-3.5.min.js"></script>
	<script src="/site_media/admin/zTree/js/jquery.ztree.exedit-3.5.min.js"></script>
	<link href="/site_media/admin/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css" />
	<link href="/site_media/admin/zTree/css/demo.css?1=1" rel="stylesheet" type="text/css" />
<script>
var currVal = null;
function addHoverDom(treeId,treeNode) 
{
	var aObj = $("#" + treeNode.tId + "_a");
	if ($("#diyBtn_"+treeNode.id).length>0) return;
	var editStr = "<span id='diyBtn_space_" +treeNode.id+ "' >&nbsp;&nbsp;&nbsp;</span>"
		+ "<button type='button' class='btn' id='diyBtn_" + treeNode.id
		+ "' >选择</button>";
	aObj.append(editStr);
	var btn = $("#diyBtn_"+treeNode.id);
	if (btn) btn.bind("click", function(){  
	OnTree(treeNode.val,treeNode.name);
	getCurrentDialog($("#treeDemo")).close()
	  });
};
function removeHoverDom(treeId,treeNode) {
	$("#diyBtn_"+treeNode.id).unbind().remove();
	$("#diyBtn_space_" +treeNode.id).unbind().remove();
};
var setting = 
{
			data: {
				simpleData: {
					enable: true
				}
			},
		   view: {
				addHoverDom:addHoverDom,
				removeHoverDom:removeHoverDom,
			}
};

closetree=function()
{
	OnTree("","");
	getCurrentDialog($("#treeDemo")).close()
}


$(function()
{
  info();
});

function info()
{
 //请求回数据
 $.AjaxServer("/AdminMain/ArticleType/DoTree/",{},function(data)
 {
    	$.fn.zTree.init($("#treeDemo"), setting, data);
 });
}
</script>

<div class="zTreeDemoBackground left">
    <ul id="treeDemo" class="ztree" style="margin-top:0px">
     加载中...
    </ul>
</div>
<br/>
 <input type="button" onclick="closetree()"  value="清空" class="btn">

	
